<template>
  <!-- 首页轮播图 -->
  <div class="home-banner-box">
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in bannerList"
        :key="item.id">
        <img :src="item.img_url" alt="" />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { ajax } from '@/utils/ajax.js'
import { SystemApis } from '@/utils/apis'

export default {
  data () {
    return {
      bannerList: []
    }
  },
  methods: {
    getDataList () {
      ajax.get(SystemApis.sliderListUrl).then(res => {
        console.log('res:', res)
        this.bannerList = res.data.objects
      })
    } 
  },
  created () {
    this.getDataList()
  }
}
</script>
<style scoped>

.my-swipe img{
  width: 100%;
  height: 600px;
}

</style>
